<?php
class cls_data_supplier extends cls_data_base
{

	var $table_name = '`supplier`';
	
	function get_supplier_list()
	{
		$sql = "select * from {$this->table_name}";
		$supplier_list = $this->db->getAll($sql);
		return $supplier_list;
	}
	
	function get_supplier_info($sp_name)
	{
		$supplier_name = mysql_real_escape_string($supplier_name);
		$sql = "select * from {$this->table_name} where sp_name = '{$sp_name}'";
		$supplier_info = $this->db->getRow($sql);
		return $supplier_info;
	}
	
	function create($value)
	{
		foreach ($value as $k=>$v) {
			$value[$k] = mysql_real_escape_string($v);
		}
		$this->db->insert($this->table_name, $value);
		return return_info();
	}
}